import request from '@/utils/request'

// 查询设备列表
export function listDevice(query) {
  return request({
    url: '/ips/device/list',
    method: 'get',
    params: query
  })
}
// 查询叫号器设备列表
export function callListDevice(query) {
  return request({
    url: '/ips/device/callList',
    method: 'get',
    params: query
  })
}
// 查询排期可选设备列表
export function listDeviceScheduling(query) {
  return request({
    url: '/ips/device/listScheduling',
    method: 'get',
    params: query
  })
}

// 查询排期已选设备列表
export function listDeviceSchedulingChoice(query) {
  return request({
    url: '/ips/device/listSchedulingChoice',
    method: 'get',
    params: query
  })
}

export function deviceList(query) {
  return request({
    url: '/ips/device/deviceList',
    method: 'get',
    params: query
  })
}

// 查询设备详细
export function getDevice(id) {
  return request({
    url: '/ips/device/' + id,
    method: 'get'
  })
}

// 查询设备状态
export function getStatusInfo(code) {
  return request({
    url: '/ips/device/statusInfo/' + code,
    method: 'get'
  })
}

// 新增设备
export function addDevice(data) {
  return request({
    url: '/ips/device/save',
    method: 'post',
    data: data
  })
}

// 修改设备
export function editDevice(data) {
  return request({
    url: '/ips/device/update',
    method: 'put',
    data: data
  })
}

// 批量修改设备
export function batchEditDevice(data, ids) {
  return request({
    url: '/ips/device/batchEdit/' + ids,
    method: 'put',
    data: data
  })
}

// 删除设备
export function delDevice(id) {
  return request({
    url: '/ips/device/remove/' + id,
    method: 'delete'
  })
}

// 更新设备状态
export function updateStatus(id) {
  return request({
    url: '/ips/device/updateStatus/' + id,
    method: 'get'
  })
}

// 导出设备
export function exportDevice(query, id) {
  return request({
    url: '/ips/device/export/' + id,
    method: 'get',
    params: query
  })
}

// 定时开关机
export function switchTiming(data) {
  return request({
    url: '/ips/device/switchTiming',
    method: 'post',
    data
  })
}

// 截屏
export function shotImage(id) {
  return request({
    url: '/ips/device/snapshot/' + id,
    method: 'get'
  })
}

// 升级APP
export function upgradeApp(way, ids, id) {
  return request({
    url: '/ips/device/upgradeApp/' + way + '/' + ids + '/' + id,
    method: 'get'
  })
}

// 模式设置
export function setMode(way, ids, value) {
  return request({
    url: '/ips/device/setMode/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 背光设置
export function setBacklight(way, ids, value) {
  return request({
    url: '/ips/device/setBacklight/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 亮度设置
export function setBrightness(way, ids, value) {
  return request({
    url: '/ips/device/setBrightness/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 音量设置
export function setVolume(way, ids, value) {
  return request({
    url: '/ips/device/setVolume/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 静音
export function muteVolume(way, ids) {
  return request({
    url: '/ips/device/muteVolume/' + way + '/' + ids,
    method: 'get'
  })
}

// 屏幕旋转
export function setRotate(way, ids, value) {
  return request({
    url: '/ips/device/setRotate/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 横竖屏设置
export function setHAV(way, ids, value) {
  return request({
    url: '/ips/device/setHAV/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 测试语音播报
export function setSpeechTest(way, ids, value) {
  return request({
    url: '/ips/device/speechTestDevice/' + way + '/' + ids + '/' + value,
    method: 'get'
  })
}

// 清空节目
export function clearplay(way, ids) {
  return request({
    url: '/ips/device/clearplay/' + way + '/' + ids,
    method: 'get'
  })
}

// 关机
export function shutdownDevice(way, ids) {
  return request({
    url: '/ips/device/shutdownDevice/' + way + '/' + ids,
    method: 'get'
  })
}

// 重启
export function rebootDevice(way, ids) {
  return request({
    url: '/ips/device/rebootDevice/' + way + '/' + ids,
    method: 'get'
  })
}

// 开始播放
export function startPlay(way, ids) {
  return request({
    url: '/ips/device/startPlay/' + way + '/' + ids,
    method: 'get'
  })
}

// 停止播放
export function stopPlay(way, ids) {
  return request({
    url: '/ips/device/stopPlay/' + way + '/' + ids,
    method: 'get'
  })
}
